<!DOCTYPE html >
<html>
<head>
    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.line.js" ></script>
    
    <title>RGraph demo: A filled spline chart with a max value</title>

    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />

    <meta name="robots" content="noindex,nofollow" />
    <meta name="description" content="A filled spline chart with a max value" />
</head>
<body>

    <!-- Share buttons -->
    <p style="float: right">
        <script>
            document.write('<a href="" target="_blank" onclick="window.open(\'https://www.facebook.com/sharer/sharer.php?u=http://www.rgraph.net' + location.pathname + '\', null, \'top=50,left=50,width=600,height=368\'); return false"><img src="../images/facebook-large.png" width="200" height="43" alt="Share on Facebook" border="0" title="Visit the RGraph Facebook page" id="facebook_link" /></a>&nbsp;');
            document.write('<a href="https://twitter.com/_rgraph" target="_blank" onclick="window.open(\'https://twitter.com/intent/tweet?text=Check%20out%20this%20demo%20of%20RGraph:%202D/3D%20JavaScript%20charts%20-%20Free%20and%20Open%20Source%20http://www.rgraph.net' + location.pathname + '\', null, \'top=50,left=50,width=700,height=400\'); return false"><img src="../images/twitter-large.png" width="200" height="43" alt="Share on Twitter" border="0" title="Mention RGraph on Twitter" id="twitter_link" /></a>');
        </script>
    </p>


    <h1>A filled spline chart with a max value</h1>


   <canvas id="cvs" width="600" height="250">[No canvas support]</canvas><br />

    <script>
        window.onload = function ()
        {
            var data1 = [30,29,24,25,26,24,23,22,21,18,19,17,20,23,24, 24,26,27,29,30];
            var data2 = [1,3,2,1,2,3,3,2,4,1,2,3,2,1,2,4,3,5,3,2];
            var data3 = [10,13,12,15,16,19,14,15,16,18,20,18,16,18,17,19,20,22,23,23];
            var data4 = [3,5,7,8,4,6,5,4,3,1,2,4,5,2,1,3,4,6,2,4];
            
            // Make the last dataset equal to 65
            var data5 = [], i = data1.length; while(i--) {
              data5[i] = 65 - (data1[i] + data2[i] + data3[i] + data4[i]);
            }

            var obj = new RGraph.Line({
                id: 'cvs',
                data: [data1, data2, data3, data4, data5],
                options: {
                    linewidth: 0,
                    filled: true,
                    spline: !RGraph.ISOLD,
                    colors: ['red','yellow','#0d0','yellow','red'],
                    strokestyle: 'rgba(0,0,0,0)',
                    shadow: false,
                    numxticks: 4,
                    ymax: 65,
                    noyaxis: true,
                    labels: [
                        '','','','Monday','','',
                        '','','','Tuesday','','',
                        '','','','Wednesday','','',
                        '','','','Thursday','',''
                    ],
                    tickmarks: null,
                    textSize:14,
                    scaleZerostart: true,
                    textAccessible: true
                }
            }).draw();
        };
    </script>







    <p></p>

    This goes in the documents header:
    <pre class="code">
&lt;script src="RGraph.common.core.js"&gt;&lt;/script&gt;
&lt;script src="RGraph.line.js"&gt;&lt;/script&gt;
</pre>
    
    Put this where you want the chart to show up:
    <pre class="code">
&lt;canvas id="cvs" width="600" height="250"&gt;
    [No canvas support]
&lt;/canvas&gt;
</pre>

    This is the code that generates the chart:
    <pre class="code">
&lt;script&gt;
    window.onload = function ()
    {
        var data1 = [30,29,24,25,26,24,23,22,21,18,19,17,20,23,24, 24,26,27,29,30];
        var data2 = [1,3,2,1,2,3,3,2,4,1,2,3,2,1,2,4,3,5,3,2];
        var data3 = [10,13,12,15,16,19,14,15,16,18,20,18,16,18,17,19,20,22,23,23];
        var data4 = [3,5,7,8,4,6,5,4,3,1,2,4,5,2,1,3,4,6,2,4];
        
        // Make the last dataset equal to 65
        var data5 = [], i = data1.length; while(i--) {
            data5[i] = 65 - (data1[i] + data2[i] + data3[i] + data4[i]);
        }

        var obj = new RGraph.Line({
            id: 'cvs',
            data: [data1, data2, data3, data4, data5],
            options: {
                linewidth: 0,
                filled: true,
                spline: !RGraph.ISOLD,
                colors: ['red','yellow','#0d0','yellow','red'],
                strokestyle: 'rgba(0,0,0,0)',
                shadow: false,
                numxticks: 4,
                ymax: 65,
                noyaxis: true,
                labels: [
                    '','','','Monday','','',
                    '','','','Tuesday','','',
                    '','','','Wednesday','','',
                    '','','','Thursday','',''
                ],
                tickmarks: null,
                textSize:14,
                scaleZerostart: true,
                textAccessible: true
            }
        }).draw();
    };
&lt;/script&gt;
</pre>


    


    <p>
        <a href="./">&laquo; Back</a>
    </p>

</body>
</html>